from flask import Flask
import config
from api.boku import bp as boku_bp
from api.bokuOs import bp as boku_bp_os
from api.fhxhOs import bp as fhxh_bp_os
from api.pctpOs import bp as pctp_bp_os
from api.dangdangOs import bp as dangdangOs
from api.jingdongOs import bp as jingdongOs
from api.xhsdOs import bp as xhsdOs
from api.chromePlugins.tmall import bp as chromePluginsTmall
from flask_cors import CORS

app = Flask(__name__)
CORS(app)

# 绑定配置文件
app.config.from_object(config)

app.register_blueprint(boku_bp)
# 博库发行平台上架
app.register_blueprint(boku_bp_os)
# 凤凰新华平台上架
app.register_blueprint(fhxh_bp_os)
# 出版物协同交易平台上架
app.register_blueprint(pctp_bp_os)
# 当当上架
app.register_blueprint(dangdangOs)
# 京东上架
app.register_blueprint(jingdongOs)
# 浙江新华书店上架
app.register_blueprint(xhsdOs)
# 谷歌天猫插件
app.register_blueprint(chromePluginsTmall)

@app.route('/')
def hello_world():  # put application's code here
    return config.APP_NAME


if __name__ == '__main__':
    app.run(host='0.0.0.0', port=5000, debug=True)
